package Thread2;

public class JieChengThread extends Thread{
    public int num;

    public JieChengThread(int num) {
        this.num = num;
    }

    @Override
    public void run() {
        int result =1;
        for (int i = 1; i < num+1; i++) {
           result= result*i;
        }
        System.out.println(num+"阶乘是"+result);
    }
}
